home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2005 May
/
CMCD0505.ISO
/
Software
/
Demo
/
DesktopX
/
objects
/
ktekdockv1.dxpack
/
{73FD5CF2-AAF5-4853-BE49-5C29CBE3C279}.DXScript2
< prev
next >
Wrap
Extensible Markup Language
|
2004-08-24
|
5KB
|
157 lines
<?xml version="1.0"?>
<!--DXScript Data File. Version 2.0-->
<DXScript>
<Script><![CDATA[Dim thedate, themonth, theyear, theminute
Dim firstdayofweek
Dim gsX, gsY, oX, oY
Dim viewdate, todaysdate, todaysitem
Dim showingconfig
Dim presets
Dim thecolour
Dim thebordercolour
Dim R,G,B,dR,dG,dB
Sub Object_OnScriptEnter
theminute=Minute(Now)
firstdayofweek=1
getscale
viewdate=Now()
todaysdate=DateValue(viewdate)
Object.SetTimer 100, 1000
calnav("refresh")
End Sub
Sub Object_Ontimer100
If desktopx.scriptobject("kddigitaltime").object.persiststorage("mode")="ampm" Then
digitime=FormatDateTime(Now,3)
Else
s=Cstr(Second(Now))
If len(s)=1 Then s="0"&s
digitime=FormatDateTime(Now,4)&":"&s
End If
DesktopX.Object("kddigitaltime").Text=digitime
If Minute(Now)<>theminute Then
theminute=Minute(Now)
End If
If Day(Now())<>Day(todaysdate) Then
calnav("refresh")
todaysdate=DateValue(Now())
End If
Exit Sub
If Month(viewdate)=Month(Now()) And Year(viewdate)=Year(Now()) And DateValue(todaysdate)<>DateValue(Now()) Then
calnav("refresh")
ElseIf Day(Now())=1 And Day(todaysdate)<>1 Then
calnav("refresh")
todaysdate=DateValue(Now())
End If
End Sub
Sub getscale
gsX=18
gsY=10
oX=8
oY=8
End Sub
Sub scalecal(thedate)
todaysitem=0
themonthnum=Month(thedate)
themonth=MonthName(themonthnum)
theyear=Year(thedate)
thedate=Day(thedate)
DesktopX.Object("kdcalmonth").Text=themonth
DesktopX.Object("kdcalyear").Text=theyear
'DesktopX.Object("kddigitalyear").Text=Year(Now)'time display
'DesktopX.Object("kddigitalday").Text=WeekDayName(Weekday(Now,1),False,1)'time display
'DesktopX.Object("kddigitaldate").Text=MonthName(Month(Now))&" "&Day(Now)
firstday=themonth&" 1,"&theyear
firstday=DatePart("w",firstday,firstdayofweek)
totaldays=daysinmonth(themonthnum,theyear)
i=1
For y=1 To 7
For x=1 To 7
If i<=7 Then
DesktopX.Object("kd_date"&i).Text=WeekdayName(i,True,firstdayofweek)
'DesktopX.Object("kd_date"&i).TextColor=RGB(103,191,255)
ElseIf i=Day(Now())+firstday-1+7 And themonthnum=Month(Now()) And theyear=Year(Now())Then
DesktopX.Object("kd_date"&i).Text=i+1-firstday-7
DesktopX.Object("kd_date"&i).TextColor=RGB(255,255,255)
todaysdate=DateValue(Now())
todaysitem=i
ElseIf i>=firstday+7 And i<firstday+totaldays+7 Then
DesktopX.Object("kd_date"&i).Text=i+1-firstday-7
DesktopX.Object("kd_date"&i).TextColor=RGB(103,191,255)
Else
If DesktopX.IsObject("kd_date"&i) Then
DesktopX.Object("kd_date"&i).Text=""
End If
End If
i=i+1
Next
Next
i=1
'For y=1 To 7
' For x=1 To 7
' If DesktopX.IsObject("kd_date"&i) Then
' DesktopX.Object("kd_date"&i).Move (x*gsX)-gsX+oX-(DesktopX.Object("kd_date"&i).Width/2),(y*gsY)-gsY+oY-(DesktopX.Object("kd_date"&i).Height/2)
' End If
' i=i+1
' Next
'Next
End Sub
Sub calnav(com)
viewmonth=Month(viewdate)
viewyear=Year(viewdate)
viewdate=Day(viewdate)
If com="kdcalnextmonth" Then
If viewmonth=12 Then
viewyear=viewyear+1
viewmonth=1
Else
viewmonth=viewmonth+1
End If
ElseIf com="kdcallastmonth" Then
If viewmonth=1 Then
viewyear=viewyear-1
viewmonth=12
Else
viewmonth=viewmonth-1
End If
ElseIf com="kdcalnextyear" Then
viewyear=viewyear+1
ElseIf com="kdcallastyear" Then
viewyear=viewyear-1
ElseIf com="kdcaltoday" Then
viewmonth=Month(Now())
viewyear=Year(Now())
viewdate=Day(Now())
End If
'Object_Ontimer100
viewdate=MonthName(viewmonth)&" "&viewdate&","&viewyear
scalecal(viewdate)
End Sub
Function daysinmonth(M, Y)
If Y = 0 Then
Y = Year(Now())
End If
Select Case (M)
Case 9, 4, 6, 11
daysinmonth = 30
Case 2
If (Y Mod 4 = 0) And (Y Mod 100 <> 0) Or (Y Mod 400 = 0) Then
daysinmonth = 29
Else
daysinmonth = 28
End If
Case Else
daysinmonth = 31
End Select
End Function
Sub Object_OnScriptExit
End Sub
]]></Script><Globals><Editor><PropPane>0</PropPane><EditorLeft>197</EditorLeft><EditorTop>43</EditorTop><EditorRight>1247</EditorRight><EditorBottom>868</EditorBottom></Editor><Object><LanguageCLSID>{B54F3741-5B07-11CF-A4B0-00AA004A55E8}</LanguageCLSID><ControlCLSID>{00000000-0000-0000-0000-000000000000}</ControlCLSID><ControlObjWidth>64</ControlObjWidth><ControlObjHeight>64</ControlObjHeight><RunState>1</RunState><ManualControlLoad>0</ManualControlLoad><ScriptHostVersion>2</ScriptHostVersion></Object></Globals></DXScript>